import type { RouteRecordRaw } from 'vue-router'

export const constantRoute: Array<RouteRecordRaw> = [
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login',
    meta: {
      title: '登录',
      hidden: true,
      icon: 'MostlyCloudy',
      open: false,
    },
  },
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '首页',
      hidden: true,
      icon: 'House',
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        name: 'home',
        meta: {
          title: 'home',
          icon: 'House',
        },
      },
    ],
  },
  {
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    name: 'Acl',
    meta: {
      title: '权限管理',
      hidden: true,
      icon: 'Lock',
    },
    redirect: '/role',
    children: [
      {
        path: '/role',
        component: () => import('@/views/acl/role/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          icon: 'User',
        },
      },
      {
        path: '/user',
        component: () => import('@/views/acl/user/index.vue'),
        name: 'User',
        meta: {
          title: '用户管理',
          icon: 'View',
        },
      },
      {
        path: '/menu',
        component: () => import('@/views/acl/menu/index.vue'),
        name: 'Menu',
        meta: {
          title: '菜单管理',
          icon: 'IconMenu',
        },
      },
    ],
  },
  {
    path: '/product',
    component: () => import('@/layout/index.vue'),
    name: 'Product',
    meta: {
      title: '商品管理',
      hidden: true,
      icon: 'Lock',
    },
    redirect: '/category',
    children: [
      {
        path: '/category',
        component: () => import('@/views/product/category/index.vue'),
        name: 'Category',
        meta: {
          title: '分类管理',
          icon: 'IconMenu',
        },
      },
      {
        path: '/trademark',
        component: () => import('@/views/product/trademark/index.vue'),
        name: 'Trademark',
        meta: {
          title: '品牌管理',
          icon: 'IconMenu',
        },
      },
      {
        path: '/attrgroup',
        name: '平台属性',
        meta: {
          title: '平台属性',
          icon: 'Setting',
        },
        redirect: '/attrgroup',
        children: [
          {
            path: '/attrgroup',
            component: () => import('@/views/product/attrgroup/index.vue'),
            name: '属性分组',
            meta: {
              title: '属性分组',
              icon: 'Setting',
            },
          },
          {
            path: '/baseattr',
            component: () => import('@/views/product/baseattr/index.vue'),
            name: '规则参数',
            meta: {
              title: '规则参数',
              icon: 'Setting',
            },
          },
          {
            path: '/saleattr',
            component: () => import('@/views/product/saleattr/index.vue'),
            name: '销售属性',
            meta: {
              title: '销售属性',
              icon: 'Setting',
            },
          },
        ],
      },
      {
        path: '/spu',
        name: '商品维护',
        meta: {
          title: '商品维护',
          icon: 'Setting',
        },
        redirect: '/index',
        children: [
          {
            path: '/index',
            component: () => import('@/views/product/spu/index.vue'),
            name: 'SPU管理',
            meta: {
              title: 'SPU管理',
              icon: 'Setting',
            },
          },
          {
            path: '/add',
            component: () => import('@/views/product/spu/add.vue'),
            name: '发布商品',
            meta: {
              title: '发布商品',
              icon: 'Setting',
            },
          },
          {
            path: '/manager',
            component: () => import('@/views/product/spu/manager.vue'),
            name: '商品管理',
            meta: {
              title: '商品管理',
              icon: 'Setting',
            },
          },
        ],
      },
    ],
  },
  {
    path: '/ware',
    component: () => import('@/layout/index.vue'),
    name: 'Ware',
    meta: {
      title: '库存系统',
      hidden: true,
      icon: 'Lock',
    },
    redirect: '/wareinfo',
    children: [
      {
        path: '/wareinfo',
        component: () => import('@/views/ware/wareinfo/index.vue'),
        name: 'Wareinfo',
        meta: {
          title: '仓库维护',
          icon: 'User',
        },
      },
      {
        path: '/sku',
        component: () => import('@/views/ware/sku/index.vue'),
        name: 'Sku',
        meta: {
          title: '商品库存',
          icon: 'View',
        },
      },
      {
        path: '/task',
        component: () => import('@/views/ware/task/index.vue'),
        name: 'Task',
        meta: {
          title: '库存工作单',
          icon: 'IconMenu',
        },
      },
      {
        path: '/purchaseitem',
        name: '采购单维护',
        meta: {
          title: '采购单维护',
          icon: 'Setting',
        },
        redirect: '/purchaseitem',
        children: [
          {
            path: '/purchaseitem',
            component: () => import('@/views/ware/purchaseitem/index.vue'),
            name: 'Purchaseitem',
            meta: {
              title: '采购需求',
              icon: 'Setting',
            },
          },
          {
            path: '/purchase',
            component: () => import('@/views/ware/purchase/index.vue'),
            name: 'Purchase',
            meta: {
              title: '采购单',
              icon: 'Setting',
            },
          },
        ],
      },
    ],
  },
  {
    path: '/member',
    component: () => import('@/layout/index.vue'),
    name: '会员系统',
    meta: {
      title: '会员系统',
      hidden: true,
      icon: 'Lock',
    },
    redirect: '/member',
    children: [
      {
        path: '/member',
        component: () => import('@/views/member/member/index.vue'),
        name: 'Member',
        meta: {
          title: '会员列表',
          icon: 'User',
        },
      },
      {
        path: '/level',
        component: () => import('@/views/member/level/index.vue'),
        name: 'Level',
        meta: {
          title: '会员等级',
          icon: 'View',
        },
      },
    ],
  },
  {
    path: '/coupon',
    component: () => import('@/layout/index.vue'),
    name: '优惠营销',
    meta: {
      title: '优惠营销',
      hidden: true,
      icon: 'Lock',
    },
    redirect: '/coupon',
    children: [
      {
        path: '/coupon',
        component: () => import('@/views/coupon/coupon/index.vue'),
        name: 'Coupon',
        meta: {
          title: '优惠券管理',
          icon: 'User',
        },
      },
      {
        path: '/history',
        component: () => import('@/views/coupon/history/index.vue'),
        name: 'History',
        meta: {
          title: '发放记录',
          icon: 'View',
        },
      },
      {
        path: '/subject',
        component: () => import('@/views/coupon/subject/index.vue'),
        name: 'Subject',
        meta: {
          title: '专题活动',
          icon: 'View',
        },
      },
      {
        path: '/seckill',
        component: () => import('@/views/coupon/seckill/index.vue'),
        name: 'Seckill',
        meta: {
          title: '秒杀活动',
          icon: 'View',
        },
      },
      {
        path: '/bounds',
        component: () => import('@/views/coupon/bounds/index.vue'),
        name: 'Bounds',
        meta: {
          title: '积分维护',
          icon: 'View',
        },
      },
      {
        path: '/full',
        component: () => import('@/views/coupon/full/index.vue'),
        name: 'Full',
        meta: {
          title: '满减折扣',
          icon: 'View',
        },
      },
      {
        path: '/memberprice',
        component: () => import('@/views/coupon/memberprice/index.vue'),
        name: 'Memberprice',
        meta: {
          title: '会员价格',
          icon: 'View',
        },
      },
      {
        path: '/seckillsession',
        component: () => import('@/views/coupon/seckillsession/index.vue'),
        name: 'Seckillsession',
        meta: {
          title: '每日秒杀',
          icon: 'View',
        },
      },
      {
        path: '/homeadv',
        component: () => import('@/views/coupon/homeadv/index.vue'),
        name: 'Homeadv',
        meta: {
          title: '首页广告',
          icon: 'View',
        },
      },
      {
        path: '/homesubjectspu',
        component: () => import('@/views/coupon/homesubjectspu/index.vue'),
        name: 'Homesubjectspu',
        meta: {
          title: 'SPU专题',
          icon: 'View',
        },
      },
      {
        path: '/seckillskunotice',
        component: () => import('@/views/coupon/seckillskunotice/index.vue'),
        name: 'Seckillskunotice',
        meta: {
          title: '秒杀配置',
          icon: 'View',
        },
      },
      {
        path: '/skuladder',
        component: () => import('@/views/coupon/skuladder/index.vue'),
        name: 'Skuladder',
        meta: {
          title: '打折优惠',
          icon: 'View',
        },
      },
    ],
  },
  {
    path: '/schedule',
    component: () => import('@/layout/index.vue'),
    name: '任务调度',
    meta: {
      title: '任务调度',
      hidden: true,
      icon: 'Lock',
    },
    redirect: '/schedule',
    children: [
      {
        path: '/schedule',
        component: () => import('@/views/schedule/schedule/index.vue'),
        name: 'Schedule',
        meta: {
          title: '任务调度',
          icon: 'User',
        },
      },
    ],
  },
  {
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '404',
      hidden: true,
      icon: 'Connection',
    },
  },
  {
    path: '/:pathMatch(.*)*', // 捕获所有未定义的路由
    component: () => import('@/views/404/index.vue'),
    name: 'Any',
    meta: {
      title: '任意路由',
      hidden: true,
      icon: 'Cloudy',
    },
  },
]
